﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using pokerServer.ProtHandlers.Interfaces;
using ConnectionControl;
using pokerServer.ProtHandlers.Concrete;

namespace pokerServer.ProtHandlers.Factories
{
	class RequestFact : IHandler
	{
		public IProtHandle getHandler(string[] s, ConnectionManag cm, ClientConnection cc)
		{
			IProtHandle handler;
			switch (s[1])
			{
				case "PLAYERLIST":
					handler = new UserRequestsProtHandler(cm, cc.myPlayer,s[2]);
					break;
				case "TABLELIST":
					handler = new TableRequestsProtHandler(cm);
					break;
				case "USERSTAT":
					handler = new PlayerStatRequest(cc);
					break;
				default:
					handler = new quitHandler(s);
					break;

			}
			return handler;
		}
	}
}
